package com.hooper.hosp.service;

import com.hooper.hosp.model.hosp.Schedule;
import com.hooper.hosp.vo.hosp.ScheduleOrderVo;
import com.hooper.hosp.vo.hosp.ScheduleQueryVo;
import org.springframework.data.domain.Page;

import java.util.List;
import java.util.Map;

/**
 * @author Tim Hooper
 * @version 1.0
 * @time 2022/09/28/18:32
 */
public interface ScheduleService {
    /**
     * save or update batch schedules by json
     * @param map map to json
     */
    void saveOrUpdate(Map<String, Object> map);

    /**
     * page query by conditions
     * @param page  current page
     * @param limit  page size
     * @param queryVo conditions
     * @return
     */
    Page<Schedule> pageSchedule(int page, int limit, ScheduleQueryVo queryVo);

    /**
     * remove a schedule by hosp code and schdule id
     * @param hoscode    hosp code
     * @param scheduleId schedule id
     */
    void removeByHoscodeAndScheduleId(String hoscode, String scheduleId);

    /**
     * find all schedules of the department by its hoscode and department code
     * @param hoscode hosp code
     * @param depcode department code
     * @param currentPage current page
     * @param pageSize how many records in a page
     * @return        all the schedules
     */
    Map<String,Object> findAllByHoscodeAndDepcode(int currentPage,int pageSize,String hoscode, String depcode);

    /**
     * 获取排班的详情信息
     * @param depcode 部门号
     * @param hoscode 医院号
     * @param workDate 工作日期
     * @return
     */
    List<Schedule> getDetail(String depcode, String hoscode, String workDate);

    /**
     * 获取医院预约规则
     * @param page    当前页
     * @param limit   页面大小
     * @param hoscode 医院号
     * @param depcode 部门号
     * @return
     */
    Map<String,Object> getBookingScheduleRule(Integer page, Integer limit, String hoscode, String depcode);

    /**
     * get one schedule by its id
     * @param scheduleId id
     * @return
     */
    Schedule getScheduleById(String scheduleId);

    ScheduleOrderVo getScheduleOrderVo(String scheduleId);

    void update(Schedule schedule);
}
